<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			// 立即执行函数函数参数和返回值
			let res = (function (name) {
				var msg = '立即执行函数中的变量'
				console.log('逻辑执行函数参数:', name, msg)
				return name
			})('why')

			// 获取不到立即执行函数中的变量
			// console.log('立即执行函数外获取立即执行函数中的变量:', msg)

			console.log('res :>> ', res)
		</script>
	</body>
</html>
